FROM golang:1.22-bullseye
COPY . /project
WORKDIR /project
RUN go mod tidy
RUN go build -o /app/vitepress-serve
RUN cd /app && ls -alh

FROM debian:bullseye
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates
COPY --from=0 /app /app
WORKDIR /app
RUN chmod +x ./vitepress-serve
CMD ["./vitepress-serve"]
